<?php
	session_start();
	
//	print_r($_POST);exit();
	require_once('../../lib/'.'BaseDir.inc.htm');
	require_once (EIU_LIB.'View.class.htm');
	require_once('../../lib/'.'DBCommon.class.htm');
	
	$oDB = new DBCommon();
	$conn =  $oDB->stl_openConn();
//	print_r($_POST);exit();
	if(isset($_POST['assCode']) && !empty($_POST['assCode'])){
		$condition = " WHERE `isDeleted`=0 AND `CATCode` ='".$_POST['assCode']."'";
		$q_assetList = "SELECT DISTINCT(`AssName`) AS Name FROM  `asset_tbl`".$condition;
	}
		
	$rs_assetList = $oDB->stl_db_select($q_assetList, $conn);
	//print_r($rs_assetList);exit();
	$data1['assetList']='';	
	
	if(is_array($rs_assetList)){
		$i=0;
		foreach($rs_assetList as $key=>$value){
			$data1['assetList'][$i]['RecordID']		=	$i+1;
			$data1['assetList'][$i]['Code']			=	$rs_assetList[$key]->Name;
			$data1['assetList'][$i]['Name']			=	$rs_assetList[$key]->Name;
			$i++;
		}
	}
	
	
//	print_r($data1);
	echo json_encode($data1);
	
	$oDB->stl_closeConn($conn);

?>
